﻿import QtQuick
 import QtQuick.Controls.Basic

 CheckBox {
    id: control
    text: qsTr("CheckBox")
    checked: true
    property real iwidth: 22
    property real iheight: 22

    indicator: Rectangle {
        implicitWidth: control.iwidth
        implicitHeight: control.iheight
        // x: control.leftPadding
        // y: parent.height / 2 - height / 2
        radius: 7
        border.color: control.down ? "#949494" : "#C4C4C4"
        anchors.verticalCenter: parent.verticalCenter

        Rectangle {
            width: 12
            height: 12
            // x: 6
            // y: 6
            radius: 4
            color: control.down ? "#e0e0e0" : "#c5a391"
            visible: control.checked
            anchors.centerIn: parent
        }
    }

    contentItem: Text {
        text: control.text
        font: control.font
        opacity: enabled ? 1.0 : 0.3
        color: control.down ? "#3A3A3A" : "#595959"
        verticalAlignment: Text.AlignVCenter
        leftPadding: control.indicator.width // + control.spacing
    }
 }
